﻿<Window x:Class="RealEstateBrowser.Views.AdvancedSearchWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="AdvancedSearchWindow" Height="600" Width="850">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition MaxHeight="500" Height="auto"/>
        </Grid.RowDefinitions>
        
        <StackPanel Margin="5">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="ID: " FontWeight="Bold"/>
                <TextBox x:Name="TextBoxID" Text="{Binding AdvancedSearchProperties.Id}" Width="50"/>
                <TextBlock Text="Active: "/>
                <CheckBox x:Name="CheckBoxActive" IsChecked="{Binding AdvancedSearchProperties.Active}"/>

                <TextBlock Text="EstateType: "/>
                <ComboBox x:Name="ComboBoxEstateTypes" ItemsSource="{Binding EstateTypes}" MinWidth="50"
                          SelectedItem="{Binding AdvancedSearchProperties.EstateType}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <TextBlock Text="{Binding EstateType.EstateTypeName}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <TextBlock Text="OfferType: "/>
                <ComboBox x:Name="ComboBoxOfferTypes" ItemsSource="{Binding OfferTypes}" MinWidth="50"
                          DisplayMemberPath="OfferType.OfferTypeName"
                          SelectedItem="{Binding AdvancedSearchProperties.OfferType}"/>
                <DatePicker x:Name="CalendarName" SelectedDate="{Binding AdvancedSearchProperties.Date}"/>
            
                
                
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="5 5 5 5">
                <TextBlock Text="Town"/>
                <ComboBox x:Name="ComboBoxTowns" ItemsSource="{Binding Towns}" MinWidth="50"
                          DisplayMemberPath="Town.TownName"
                          SelectedItem="{Binding CurrentTown}"/>
                <TextBlock Text="District: "/>
                <ComboBox x:Name="ComboBoxDistricts" ItemsSource="{Binding Districts}" MinWidth="50"
                          DisplayMemberPath="District.DistrictName"
                          SelectedItem="{Binding CurrentDistrict}"/>
                <TextBlock Text="Price: "/>
                <TextBox x:Name="TextBoxPrice" Text="{Binding AdvancedSearchProperties.Price}" Width="50"/>
                <TextBlock Text="Size: "/>
                <TextBox x:Name="TextBoxSize" Text="{Binding AdvancedSearchProperties.Size}" Width="50"/>
               
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <ListView ItemsSource="{Binding AdvancedSearchProperties.Extras}">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Extra.ExtraName}"/>
                                    <CheckBox IsChecked="{Binding IsChecked}"/>
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
                
            </StackPanel>
            <StackPanel>
                <Button Content="Search" Command="{Binding FilterCommand}"/>
            </StackPanel>
        </StackPanel>

    </Grid>
</Window>
